/*
 * Copyright 2005-2013 sxhuayuan.com. All rights reserved.
 */
package com.sxhuayuan.parking.compenent.domain;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.hibernate.validator.constraints.Length;

import com.sxhuayuan.parking.config.Platform;

/**
 * 系统设置
 * 
 * @author gaoyan
 * @version 1.0
 */
public class Setting implements Serializable {

	private static final long serialVersionUID = -1478999889661796840L;

	/**
	 * 小数位精确方式
	 */
	public enum RoundType {

		/** 四舍五入 */
		roundHalfUp,

		/** 向上取整 */
		roundUp,

		/** 向下取整 */
		roundDown
	}

	/**
	 * 验证码类型
	 */
	public enum CaptchaType {

		/** 后台登录 */
		adminLogin,

		/** 用户登录 */
		memberLogin,

		/** 代理 */
		agentLogin,

		/** 停车场用户 */
		parkingLotLogin,

		/** 其它 */
		other,

		/** 业务员登录 */
		salesmanLogin
	}

	/**
	 * 账号锁定类型
	 */
	public enum AccountLockType {

		/** 管理员 */
		admin,

		/** user */
		user,

		/** 代理 */
		agent,

		/** 停车场用户 */
		parkingLot,

		/** 业务员 */
		salesman
	}

	/** 缓存名称 */
	public static final String CACHE_NAME = "setting";

	/** 缓存Key */
	public static final Integer CACHE_KEY = 0;

	/** 分隔符 */
	private static final String SEPARATOR = ",";

	private Boolean isDebug;

	/** 备案编号 */
	private String certtext;

	/** 是否网站开启 */
	private Boolean isSiteEnabled;

	/** 网站关闭消息 */
	private String siteCloseMessage;

	/** 网站名称 */
	private String siteName;

	/** 公司名称 */
	private String company;

	/** 网站网址 */
	private String siteUrl;

	/** logo */
	private String logo;

	/** 服务电话 */
	private String servicePhone;

	/** 价格精确方式 */
	private RoundType priceRoundType;

	/** 价格精确位数 */
	private Integer priceScale;

	/** Cookie路径 */
	private String cookiePath;

	/** Cookie作用域 */
	private String cookieDomain;

	/** 上传文件最大限制 */
	private Integer uploadMaxSize;

	/** 上传图片最大限制 */
	private Integer uploadImageMaxSize;

	/** 允许上传图片扩展名 */
	private String uploadImageExtension;

	/** 允许上传文件扩展名 */
	private String uploadFileExtension;

	/** 图片上传路径 */
	private String imageUploadPath;

	/** 文件上传路径 */
	private String fileUploadPath;

	/** 错误日志上传路径 */
	private String errorLogUploadPath;

	/** 禁用用户名 */
	private String disabledUsername;

	/** 用户名最小长度 */
	private Integer usernameMinLength;

	/** 用户名最大长度 */
	private Integer usernameMaxLength;

	/** 密码最小长度 */
	private Integer passwordMinLength;

	/** 密码最大长度 */
	private Integer passwordMaxLength;

	/** 验证码类型 */
	private CaptchaType[] captchaTypes;

	/** 账号锁定类型 */
	private AccountLockType[] accountLockTypes;

	/** 自动解锁时间 */
	private Integer accountLockTime;

	/** 连续登录失败最大次数 */
	private Integer accountLockCount;

	/** 安全密匙有效时间 */
	private Integer safeKeyExpiryTime;

	/** 货币符号 */
	private String currencySign;

	/** 货币单位 */
	private String currencyUnit;

	private String privateKey;

	private String publicKey;

	// /** 公众号AppId */
	// private String weChatAppId;
	// /** 公众号 secret */
	// private String weChatSecret;
	// /** 公众号获取用户信息的方式 -one */
	// private String snsapiBase;
	// /** 公众号获取用户信息的方式 -two */
	// private String snsapiUserinfo;
	// /** 支付平台微信统一下单接口 */
	// private String weChatPlaceOrder;
	// /** 支付宝配置参数 */
	// /** appId */
	// private String alipayAppId;
	// /** pId */
	// private String alipayPid;
	// /** 支付宝的下单地址 */
	// private String alipayOpenApiDomain;
	// /** 支付宝的私钥key */
	// private String alipayPrivateKey;
	// /** 支付宝的共钥key */
	// private String alipayPublicKey;

	/** account */
	private String account; // 账户类型

	/** 官方通道 */
	private String officialPass;
	/** 银行通道 */
	private String bankPass;
	/** 订单超时天数，超时后系统会自动删除订单，节省数据开销 */
	private Integer orderTimeoutDays;
	/** 最多绑定车牌数 */
	private Integer maxCarPlateCount;
	/** 是否授权获取用户基本信息 */
	private Boolean isGetUserInfo;
	/** 系统异常通知发送的最小间隔（分钟） */
	private Integer systemErrorNoticeMinIntervalSec;
	/** 无感优先级 */
	private Platform[] partnersWeight;
	/** 测试车场编号 */
	private String testParkingLotSn;
	/** 测试虚拟车牌号 */
	private String testCarPlate;

	/** 多个用逗号分开。测试车牌列表，和ParkingLot的isDebug配置使用，必须开始isDebug且车牌设置为测试车牌才可以支付1分钱 完成缴费 */
	private String debugCarPlateList;

	/** 测试车牌预支付金额 */
	private String testPaymentMoney;
	/** 大华接口模式 */
	private Integer dahuaInterfaceMode;

	/**
	 * 获取备案编号
	 * 
	 * @return 备案编号
	 */
	@Length(max = 200)
	public String getCerttext() {
		return certtext;
	}

	/**
	 * 设置备案编号
	 * 
	 * @param certtext
	 *            备案编号
	 */
	public void setCerttext(String certtext) {
		this.certtext = certtext;
	}

	/**
	 * 获取是否网站开启
	 * 
	 * @return 是否网站开启
	 */
	@NotNull
	public Boolean getIsSiteEnabled() {
		return isSiteEnabled;
	}

	/**
	 * 设置是否网站开启
	 * 
	 * @param isSiteEnabled
	 *            是否网站开启
	 */
	public void setIsSiteEnabled(Boolean isSiteEnabled) {
		this.isSiteEnabled = isSiteEnabled;
	}

	/**
	 * 获取网站关闭消息
	 * 
	 * @return 网站关闭消息
	 */
	@NotEmpty
	public String getSiteCloseMessage() {
		return siteCloseMessage;
	}

	/**
	 * 设置网站关闭消息
	 * 
	 * @param siteCloseMessage
	 *            网站关闭消息
	 */
	public void setSiteCloseMessage(String siteCloseMessage) {
		this.siteCloseMessage = siteCloseMessage;
	}

	/**
	 * 获取网站名称
	 * 
	 * @return 网站名称
	 */
	@NotEmpty
	@Length(max = 200)
	public String getSiteName() {
		return siteName;
	}

	/**
	 * 设置网站名称
	 * 
	 * @param siteName
	 *            网站名称
	 */
	public void setSiteName(String siteName) {
		this.siteName = siteName;
	}

	/**
	 * 获取网站网址
	 * 
	 * @return 网站网址
	 */
	@NotEmpty
	@Length(max = 200)
	public String getSiteUrl() {
		return siteUrl;
	}

	/**
	 * 设置网站网址
	 * 
	 * @param siteUrl
	 *            网站网址
	 */
	public void setSiteUrl(String siteUrl) {
		this.siteUrl = StringUtils.removeEnd(siteUrl, "/");
	}

	/**
	 * 获取logo
	 * 
	 * @return logo
	 */
	@NotEmpty
	@Length(max = 200)
	public String getLogo() {
		return logo;
	}

	/**
	 * 设置logo
	 * 
	 * @param logo
	 *            logo
	 */
	public void setLogo(String logo) {
		this.logo = logo;
	}

	/**
	 * 获取价格精确位数
	 * 
	 * @return 价格精确位数
	 */
	@NotNull
	@Min(0)
	@Max(3)
	public Integer getPriceScale() {
		return priceScale;
	}

	/**
	 * 设置价格精确位数
	 * 
	 * @param priceScale
	 *            价格精确位数
	 */
	public void setPriceScale(Integer priceScale) {
		this.priceScale = priceScale;
	}

	/**
	 * 获取价格精确方式
	 * 
	 * @return 价格精确方式
	 */
	@NotNull
	public RoundType getPriceRoundType() {
		return priceRoundType;
	}

	/**
	 * 设置价格精确方式
	 * 
	 * @param priceRoundType
	 *            价格精确方式
	 */
	public void setPriceRoundType(RoundType priceRoundType) {
		this.priceRoundType = priceRoundType;
	}

	/**
	 * 获取Cookie路径
	 * 
	 * @return Cookie路径
	 */
	@NotEmpty
	@Length(max = 200)
	public String getCookiePath() {
		return cookiePath;
	}

	/**
	 * 设置Cookie路径
	 * 
	 * @param cookiePath
	 *            Cookie路径
	 */
	public void setCookiePath(String cookiePath) {
		if (cookiePath != null && !cookiePath.endsWith("/")) {
			cookiePath += "/";
		}
		this.cookiePath = cookiePath;
	}

	/**
	 * 获取Cookie作用域
	 * 
	 * @return Cookie作用域
	 */
	@Length(max = 200)
	public String getCookieDomain() {
		return cookieDomain;
	}

	/**
	 * 设置Cookie作用域
	 * 
	 * @param cookieDomain
	 *            Cookie作用域
	 */
	public void setCookieDomain(String cookieDomain) {
		this.cookieDomain = cookieDomain;
	}

	/**
	 * 获取上传文件最大限制，单位KB
	 * 
	 * @return 上传文件最大限制
	 */
	@NotNull
	@Min(0)
	public Integer getUploadMaxSize() {
		return uploadMaxSize;
	}

	/**
	 * 设置上传文件最大限制，单位KB
	 * 
	 * @param uploadMaxSize
	 *            上传文件最大限制
	 */
	public void setUploadMaxSize(Integer uploadMaxSize) {
		this.uploadMaxSize = uploadMaxSize;
	}

	/**
	 * 获取上传图片最大限制
	 * 
	 * @return 上传图片最大限制
	 */
	@NotNull
	@Min(0)
	public Integer getUploadImageMaxSize() {
		return uploadImageMaxSize;
	}

	/**
	 * 设置上传图片最大限制
	 * 
	 * @param uploadImageMaxSize
	 *            上传图片最大限制
	 */
	public void setUploadImageMaxSize(Integer uploadImageMaxSize) {
		this.uploadImageMaxSize = uploadImageMaxSize;
	}

	/**
	 * 获取允许上传图片扩展名
	 * 
	 * @return 允许上传图片扩展名
	 */
	@Length(max = 200)
	public String getUploadImageExtension() {
		return uploadImageExtension;
	}

	/**
	 * 设置允许上传图片扩展名
	 * 
	 * @param uploadImageExtension
	 *            允许上传图片扩展名
	 */
	public void setUploadImageExtension(String uploadImageExtension) {
		if (uploadImageExtension != null) {
			uploadImageExtension = uploadImageExtension.replaceAll("[,\\s]*,[,\\s]*", ",").replaceAll("^,|,$", "").toLowerCase();
		}
		this.uploadImageExtension = uploadImageExtension;
	}

	/**
	 * 获取允许上传文件扩展名
	 * 
	 * @return 允许上传文件扩展名
	 */
	@Length(max = 200)
	public String getUploadFileExtension() {
		return uploadFileExtension;
	}

	/**
	 * 设置允许上传文件扩展名
	 * 
	 * @param uploadFileExtension
	 *            允许上传文件扩展名
	 */
	public void setUploadFileExtension(String uploadFileExtension) {
		if (uploadFileExtension != null) {
			uploadFileExtension = uploadFileExtension.replaceAll("[,\\s]*,[,\\s]*", ",").replaceAll("^,|,$", "").toLowerCase();
		}
		this.uploadFileExtension = uploadFileExtension;
	}

	/**
	 * 获取图片上传路径
	 * 
	 * @return 图片上传路径
	 */
	@NotEmpty
	@Length(max = 200)
	public String getImageUploadPath() {
		return imageUploadPath;
	}

	/**
	 * 设置图片上传路径
	 * 
	 * @param imageUploadPath
	 *            图片上传路径
	 */
	public void setImageUploadPath(String imageUploadPath) {
		if (imageUploadPath != null) {
			if (!imageUploadPath.startsWith("/")) {
				imageUploadPath = "/" + imageUploadPath;
			}
			if (!imageUploadPath.endsWith("/")) {
				imageUploadPath += "/";
			}
		}
		this.imageUploadPath = imageUploadPath;
	}

	/**
	 * 获取文件上传路径
	 * 
	 * @return 文件上传路径
	 */
	@NotEmpty
	@Length(max = 200)
	public String getFileUploadPath() {
		return fileUploadPath;
	}

	/**
	 * 设置文件上传路径
	 * 
	 * @param fileUploadPath
	 *            文件上传路径
	 */
	public void setFileUploadPath(String fileUploadPath) {
		if (fileUploadPath != null) {
			if (!fileUploadPath.startsWith("/")) {
				fileUploadPath = "/" + fileUploadPath;
			}
			if (!fileUploadPath.endsWith("/")) {
				fileUploadPath += "/";
			}
		}
		this.fileUploadPath = fileUploadPath;
	}

	/**
	 * 获取日志上传路径
	 * 
	 * @return 日志上传路径
	 */
	@NotEmpty
	@Length(max = 200)
	public String getErrorLogUploadPath() {
		return errorLogUploadPath;
	}

	/**
	 * 设置日志上传路径
	 * 
	 * @param errorLogUploadPath
	 *            日志文件上传路径
	 */
	public void setErrorLogUploadPath(String errorLogUploadPath) {
		if (errorLogUploadPath != null) {
			if (!errorLogUploadPath.startsWith("/")) {
				errorLogUploadPath = "/" + errorLogUploadPath;
			}
			if (!errorLogUploadPath.endsWith("/")) {
				errorLogUploadPath += "/";
			}
		}
		this.errorLogUploadPath = errorLogUploadPath;
	}

	/**
	 * 获取允许上传图片扩展名
	 * 
	 * @return 允许上传图片扩展名
	 */
	public String[] getUploadImageExtensions() {
		return StringUtils.split(uploadImageExtension, SEPARATOR);
	}

	/**
	 * 获取允许上传文件扩展名
	 * 
	 * @return 允许上传文件扩展名
	 */
	public String[] getUploadFileExtensions() {
		return StringUtils.split(uploadFileExtension, SEPARATOR);
	}

	/**
	 * 设置精度
	 * 
	 * @param amount
	 *            数值
	 * @return 数值
	 */
	public BigDecimal setScale(BigDecimal amount) {
		if (amount == null) {
			return null;
		}
		int roundingMode;
		if (getPriceRoundType() == RoundType.roundUp) {
			roundingMode = BigDecimal.ROUND_UP;
		} else if (getPriceRoundType() == RoundType.roundDown) {
			roundingMode = BigDecimal.ROUND_DOWN;
		} else {
			roundingMode = BigDecimal.ROUND_HALF_UP;
		}
		return amount.setScale(getPriceScale(), roundingMode);
	}

	/**
	 * @Title: getDisabledUsername
	 * @Description: 禁用的用户名
	 * @return String
	 */
	@Length(max = 200)
	public String getDisabledUsername() {
		return disabledUsername;
	}

	public void setDisabledUsername(String disabledUsername) {
		this.disabledUsername = disabledUsername;
	}

	/**
	 * 获取禁用用户名
	 * 
	 * @return 禁用用户名
	 */
	public String[] getDisabledUsernames() {
		return StringUtils.split(disabledUsername, SEPARATOR);
	}

	/**
	 * 获取用户名最小长度
	 * 
	 * @return 用户名最小长度
	 */
	@NotNull
	@Min(1)
	@Max(117)
	public Integer getUsernameMinLength() {
		return usernameMinLength;
	}

	/**
	 * 设置用户名最小长度
	 * 
	 * @param usernameMinLength
	 *            用户名最小长度
	 */
	public void setUsernameMinLength(Integer usernameMinLength) {
		this.usernameMinLength = usernameMinLength;
	}

	/**
	 * 获取用户名最大长度
	 * 
	 * @return 用户名最大长度
	 */
	@NotNull
	@Min(1)
	@Max(117)
	public Integer getUsernameMaxLength() {
		return usernameMaxLength;
	}

	/**
	 * 设置用户名最大长度
	 * 
	 * @param usernameMaxLength
	 *            用户名最大长度
	 */
	public void setUsernameMaxLength(Integer usernameMaxLength) {
		this.usernameMaxLength = usernameMaxLength;
	}

	/**
	 * 获取密码最小长度
	 * 
	 * @return 密码最小长度
	 */
	@NotNull
	@Min(1)
	@Max(117)
	public Integer getPasswordMinLength() {
		return passwordMinLength;
	}

	/**
	 * 设置密码最小长度
	 * 
	 * @param passwordMinLength
	 *            密码最小长度
	 */
	public void setPasswordMinLength(Integer passwordMinLength) {
		this.passwordMinLength = passwordMinLength;
	}

	/**
	 * 获取密码最大长度
	 * 
	 * @return 密码最大长度
	 */
	@NotNull
	@Min(1)
	@Max(117)
	public Integer getPasswordMaxLength() {
		return passwordMaxLength;
	}

	/**
	 * 设置密码最大长度
	 * 
	 * @param passwordMaxLength
	 *            密码最大长度
	 */
	public void setPasswordMaxLength(Integer passwordMaxLength) {
		this.passwordMaxLength = passwordMaxLength;
	}

	/**
	 * 获取验证码类型
	 * 
	 * @return 验证码类型
	 */
	public CaptchaType[] getCaptchaTypes() {
		return captchaTypes;
	}

	public void setCaptchaTypes(CaptchaType[] captchaTypes) {
		this.captchaTypes = captchaTypes;
	}

	/**
	 * 获取账号锁定类型
	 */
	public AccountLockType[] getAccountLockTypes() {
		return accountLockTypes;
	}

	public void setAccountLockTypes(AccountLockType[] accountLockTypes) {
		this.accountLockTypes = accountLockTypes;
	}

	/**
	 * 获取自动解锁时间
	 * 
	 * @return 自动解锁时间
	 */
	@NotNull
	@Min(0)
	public Integer getAccountLockTime() {
		return accountLockTime;
	}

	public void setAccountLockTime(Integer accountLockTime) {
		this.accountLockTime = accountLockTime;
	}

	/**
	 * 获取连续登录失败最大次数
	 * 
	 * @return 连续登录失败最大次数
	 */
	@NotNull
	@Min(1)
	public Integer getAccountLockCount() {
		return accountLockCount;
	}

	/**
	 * 设置连续登录失败最大次数
	 * 
	 * @param accountLockCount
	 *            连续登录失败最大次数
	 */
	public void setAccountLockCount(Integer accountLockCount) {
		this.accountLockCount = accountLockCount;
	}

	/**
	 * 获取安全密匙有效时间
	 * 
	 * @return 安全密匙有效时间
	 */
	@NotNull
	@Min(0)
	public Integer getSafeKeyExpiryTime() {
		return safeKeyExpiryTime;
	}

	/**
	 * 设置安全密匙有效时间
	 * 
	 * @param safeKeyExpiryTime
	 *            安全密匙有效时间
	 */
	public void setSafeKeyExpiryTime(Integer safeKeyExpiryTime) {
		this.safeKeyExpiryTime = safeKeyExpiryTime;
	}

	/**
	 * 获取货币符号
	 * 
	 * @return 货币符号
	 */
	@NotEmpty
	@Length(max = 200)
	public String getCurrencySign() {
		return currencySign;
	}

	public void setCurrencySign(String currencySign) {
		this.currencySign = currencySign;
	}

	/**
	 * 获取货币单位
	 * 
	 * @return 货币单位
	 */
	@NotEmpty
	@Length(max = 200)
	public String getCurrencyUnit() {
		return currencyUnit;
	}

	public void setCurrencyUnit(String currencyUnit) {
		this.currencyUnit = currencyUnit;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getServicePhone() {
		return servicePhone;
	}

	public void setServicePhone(String servicePhone) {
		this.servicePhone = servicePhone;
	}

	public String getPrivateKey() {
		return privateKey;
	}

	public void setPrivateKey(String privateKey) {
		this.privateKey = privateKey;
	}

	public String getPublicKey() {
		return publicKey;
	}

	public void setPublicKey(String publicKey) {
		this.publicKey = publicKey;
	}

	// public String getWeChatAppId() {
	// return weChatAppId;
	// }
	//
	// public void setWeChatAppId(String weChatAppId) {
	// this.weChatAppId = weChatAppId;
	// }
	//
	// public String getWeChatSecret() {
	// return weChatSecret;
	// }
	//
	// public void setWeChatSecret(String weChatSecret) {
	// this.weChatSecret = weChatSecret;
	// }
	//
	// public String getSnsapiBase() {
	// return snsapiBase;
	// }
	//
	// public void setSnsapiBase(String snsapiBase) {
	// this.snsapiBase = snsapiBase;
	// }
	//
	// public String getSnsapiUserinfo() {
	// return snsapiUserinfo;
	// }
	//
	// public void setSnsapiUserinfo(String snsapiUserinfo) {
	// this.snsapiUserinfo = snsapiUserinfo;
	// }
	//
	// public String getWeChatPlaceOrder() {
	// return weChatPlaceOrder;
	// }
	//
	// public void setWeChatPlaceOrder(String weChatPlaceOrder) {
	// this.weChatPlaceOrder = weChatPlaceOrder;
	// }
	//
	// public String getAlipayAppId() {
	// return alipayAppId;
	// }
	//
	// public void setAlipayAppId(String alipayAppId) {
	// this.alipayAppId = alipayAppId;
	// }
	//
	// public String getAlipayPid() {
	// return alipayPid;
	// }
	//
	// public void setAlipayPid(String alipayPid) {
	// this.alipayPid = alipayPid;
	// }
	//
	// public String getAlipayOpenApiDomain() {
	// return alipayOpenApiDomain;
	// }
	//
	// public void setAlipayOpenApiDomain(String alipayOpenApiDomain) {
	// this.alipayOpenApiDomain = alipayOpenApiDomain;
	// }
	//
	// public String getAlipayPrivateKey() {
	// return alipayPrivateKey;
	// }
	//
	// public void setAlipayPrivateKey(String alipayPrivateKey) {
	// this.alipayPrivateKey = alipayPrivateKey;
	// }
	//
	// public String getAlipayPublicKey() {
	// return alipayPublicKey;
	// }
	//
	// public void setAlipayPublicKey(String alipayPublicKey) {
	// this.alipayPublicKey = alipayPublicKey;
	// }

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public static String getSeparator() {
		return SEPARATOR;
	}

	public String getAccount() {
		return account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	public String getOfficialPass() {
		return officialPass;
	}

	public void setOfficialPass(String officialPass) {
		this.officialPass = officialPass;
	}

	public String getBankPass() {
		return bankPass;
	}

	public void setBankPass(String bankPass) {
		this.bankPass = bankPass;
	}

	public Boolean getIsDebug() {
		return isDebug;
	}

	public void setIsDebug(Boolean isDebug) {
		this.isDebug = isDebug;
	}

	public Integer getOrderTimeoutDays() {
		return orderTimeoutDays;
	}

	public void setOrderTimeoutDays(Integer orderTimeoutDays) {
		this.orderTimeoutDays = orderTimeoutDays;
	}

	public Integer getMaxCarPlateCount() {
		return maxCarPlateCount;
	}

	public void setMaxCarPlateCount(Integer maxCarPlateCount) {
		this.maxCarPlateCount = maxCarPlateCount;
	}

	public Boolean getIsGetUserInfo() {
		return isGetUserInfo;
	}

	public void setIsGetUserInfo(Boolean isGetUserInfo) {
		this.isGetUserInfo = isGetUserInfo;
	}

	public Integer getSystemErrorNoticeMinIntervalSec() {
		return systemErrorNoticeMinIntervalSec;
	}

	public void setSystemErrorNoticeMinIntervalSec(Integer systemErrorNoticeMinIntervalSec) {
		this.systemErrorNoticeMinIntervalSec = systemErrorNoticeMinIntervalSec;
	}

	public Platform[] getPartnersWeight() {
		return partnersWeight;
	}

	public void setPartnersWeight(Platform[] partnersWeight) {
		this.partnersWeight = partnersWeight;
	}

	/** 测试车场编号 */
	public String getTestParkingLotSn() {
		// 如果没设置测试车场 返回默认测试车场编号
		if (testParkingLotSn != null) {
			return testParkingLotSn;
		} else {
			return "tzhcscc";
		}
	}

	public void setTestParkingLotSn(String testParkingLotSn) {
		this.testParkingLotSn = testParkingLotSn;
	}

	public String getTestCarPlate() {
		// 如果没设置测试车牌 返回默认车牌 陕A12345
		if (testCarPlate != null) {
			return testCarPlate;
		} else {
			return "陕A12345";
		}
	}

	public void setTestCarPlate(String testCarPlate) {
		this.testCarPlate = testCarPlate;
	}

	public String getTestPaymentMoney() {
		if (StringUtils.isNotEmpty(testPaymentMoney)) {
			return "0.01";
		} else {
			return testPaymentMoney;
		}
	}

	public void setTestPaymentMoney(String testPaymentMoney) {
		this.testPaymentMoney = testPaymentMoney;
	}

	public float getFloatPaymentMoney() {
		try {
			if (StringUtils.isEmpty(testPaymentMoney)) {
				return 0.01f;
			} else {
				return Float.valueOf(this.testPaymentMoney);
			}
		} catch (Exception e) {
			return 0.01f;
		}
	}

	public Integer getDahuaInterfaceMode() {
		return dahuaInterfaceMode;
	}

	public void setDahuaInterfaceMode(Integer dahuaInterfaceMode) {
		this.dahuaInterfaceMode = dahuaInterfaceMode;
	}

	public String getDebugCarPlateList() {
		return debugCarPlateList;
	}

	public void setDebugCarPlateList(String debugCarPlateList) {
		this.debugCarPlateList = debugCarPlateList;
	}

	/***
	 * 是否是测试车牌
	 * 
	 * @return
	 */
	public boolean isDebugCarPlate(String carPlate) {
		if (StringUtils.isEmpty(debugCarPlateList)) {
			return false;
		}
		String[] carPlates = debugCarPlateList.split("\n");
		return ArrayUtils.contains(carPlates, carPlate);
	}
}